package com.reportes;

import java.util.ArrayList;
import java.util.List;

import com.downloader.ImageDownloader;
import com.downloader.PicVidBean;
import android.content.Context;
import android.database.DataSetObserver;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.BaseAdapter;

public class ImageAdapter_dinamico extends BaseAdapter  {
	
	ArrayList<PicVidBean> pvblist = new ArrayList();
	ImageDownloader imageDownloader = new ImageDownloader();
	
	List<PicVidBean> lista;
	Context context;
	LayoutInflater inflater;
	
	private final ImageDownloader imd = new ImageDownloader();
	
	public ImageAdapter_dinamico(List<PicVidBean> lista, Context context){
		this.lista = lista;
		this.context = context;
		inflater = LayoutInflater.from(context);
	}
 
	@Override
	public int getCount() {
		return lista.size();
	}

	@Override
	public Object getItem(int position) {
		return lista.get(position);
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		return null;
	}

    // create a new ImageView for each item referenced by the Adapter
    /*public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView;
        if (convertView == null) {  // if it's not recycled, initialize some attributes
            imageView = new ImageView(mContext);
            imageView.setLayoutParams(new GridView.LayoutParams(185, 185));
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setPadding(8, 8, 8, 8);
        } else {
            imageView = (ImageView) convertView;
        }
        
      
        PicVidBean picvid = pvblist.get(position);
		imageDownloader.download(picvid.getUrlImage(), imageView);
        //imageView.setImageResource();
        return imageView;
      
 
        }*/


}
